package com.bush.mall.member.controller;

import org.springframework.web.bind.annotation.*;
import com.bush.mall.common.entity.Result;;
import com.bush.mall.member.entity.MemberCollectSubjectEntity;
import com.bush.mall.member.service.MemberCollectSubjectService;
import javax.annotation.Resource;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 会员收藏的专题活动
 * @author RUN
 * @date 2022-11-29
 */
@RestController
@RequestMapping("membercollectsubject")
@Api(tags = "会员收藏的专题活动管理" )
public class MemberCollectSubjectController {

    @Resource(name= MemberCollectSubjectService.BEAN_ID)
    private MemberCollectSubjectService memberCollectSubjectService;

    /**
     * 分页查询会员收藏的专题活动列表
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "分页查询会员收藏的专题活动列表")
    @GetMapping("queryForPage")
    public Result queryForPage(Integer current,Integer size){
        return memberCollectSubjectService.queryForPage(current,size);
    }

    /**
     * 保存会员收藏的专题活动表单
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "保存会员收藏的专题活动表单")
    @PostMapping
    public Result saveMemberCollectSubject(@RequestBody MemberCollectSubjectEntity memberCollectSubject){
        return memberCollectSubjectService.saveMemberCollectSubject(memberCollectSubject);
    }

    /**
     * 修改会员收藏的专题活动表单
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "修改会员收藏的专题活动表单")
    @PutMapping
    public Result updateMemberCollectSubject(@RequestBody MemberCollectSubjectEntity memberCollectSubject){
        return memberCollectSubjectService.updateMemberCollectSubject(memberCollectSubject);
    }

    /**
     * 通过指定id删除会员收藏的专题活动
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "通过指定id删除会员收藏的专题活动")
    @DeleteMapping
    public Result deleteMemberCollectSubject(Long id){
        return memberCollectSubjectService.deleteMemberCollectSubject(id);
    }

}
